import dayjs from 'dayjs'
export const PAGE_SIZE = 10

export const PAGE_SIZE_OPTIONS = ['5', '10', '15', '20', '30', '40', '50', '75', '100', '150', '200', '300', '500']

export const FLAG_NUMBER_ENUM: SmartEnum<number> = {
    TRUE: {
        value: 1,
        desc: '是',
    },
    FALSE: {
        value: 2,
        desc: '否',
    },
}

export const showTableTotal = function (total: number | string) {
    return `共${total}条`
}
export const TIME_RANGE_PRESETS = [
    { label: '今日', value: [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')], key: 'today' },
    { label: '昨日', value: [dayjs().add(-1, 'd').format('YYYY-MM-DD'), dayjs().add(-1, 'd').format('YYYY-MM-DD')], key: 'yesterday' },
    { label: '近7天', value: [dayjs().add(-7, 'd').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')], key: 'last7days' },
    { label: '近30天', value: [dayjs().add(-30, 'd').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')], key: 'last30days' },
    { label: '全部', value: [], key: 'all'},
    { label: '自定义', value: [], key: 'custom' }
]
export const DEFAULT_TIME_RANGE = TIME_RANGE_PRESETS[3]
export default {
    FLAG_NUMBER_ENUM
}